﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="System_RoleSettings"
    ValidateRequest="false" Codefile="rolesettings.aspx.cs" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title>角色设置</title>

    <script type="text/javascript">
    
    var LOCID_TOGGLE_ROW_PRIV = "\u5207\u6362\u6b64\u884c\u7684\u6743\u9650";
    var LOCID_NO_CREATEUSER_PRIV_TITLE = "\u5728\u201c\u4e1a\u52a1\u7ba1\u7406\u201d\u9009\u9879\u5361\u7684\u201c\u7528\u6237\u8bbe\u7f6e\u201d\u8bb0\u5f55\u7c7b\u578b\u4e2d\u9009\u62e9\u7684\u201c\u521b\u5efa\u201d\u7ea7\u522b\u5fc5\u987b\u4e0e\u201c\u7528\u6237\u201d\u8bb0\u5f55\u7c7b\u578b\u4e2d\u7684\u201c\u521b\u5efa\u201d\u7ea7\u522b\u76f8\u5339\u914d\u6216\u9ad8\u4e8e\u6b64\u7ea7\u522b\u3002\u5982\u679c\u672a\u5bf9\u6b64\u8fdb\u884c\u66f4\u6539\uff0c\u5219\u6b64\u89d2\u8272\u6240\u521b\u5efa\u7684\u7528\u6237\u53ef\u80fd\u65e0\u6cd5\u8bbf\u95ee\u7cfb\u7edf\u3002";
    var LOCID_NO_CREATEUSER_PRIV_OK = "\u8981\u7ee7\u7eed\uff0c\u8bf7\u5355\u51fb\u201c\u786e\u5b9a\u201d\u3002";
    var LOCID_NO_CREATEUSER_PRIV_CANCEL = "\u8981\u66f4\u6539\u7ea7\u522b\uff0c\u8bf7\u5355\u51fb\u201c\u53d6\u6d88\u201d\u3002";
    var LOCID_BIZ_SAVING_ROLE = "\u6b63\u5728\u4fdd\u5b58\u89d2\u8272... \u8bf7\u7a0d\u5019\u3002";
    var LOCID_BIZ_ROLE_NONE = "尚未分配";
    var LOCID_BIZ_ROLE_BASIC = "\u7528\u6237";
    var LOCID_BIZ_ROLE_LOCAL = "\u4e1a\u52a1\u90e8\u95e8";
    var LOCID_BIZ_ROLE_DEEP = "\u4e0a\x3a\u4e0b\u7ea7\u4e1a\u52a1\u90e8\u95e8";
    var LOCID_BIZ_ROLE_GLOBAL = "已分配";
    var LOCID_FORMAT_ALTTAG = "该项操作的权限{0}{1}，单击即可更改";
    var LOCID_FORMAT_ALTTAGMISC = "该项操作的权限{0}{1}，单击即可更改";
    var LOCID_PRIVTYPE_CREATE = "\u521b\u5efa";
    var LOCID_PRIVTYPE_READ = "\u8bfb";
    var LOCID_PRIVTYPE_WRITE = "\u5199";
    var LOCID_PRIVTYPE_DELETE = "\u5220\u9664";
    var LOCID_PRIVTYPE_APPEND = "\u8ffd\u52a0";
    var LOCID_PRIVTYPE_APPENDTO = "\u8ffd\u52a0\u5230";
    var LOCID_PRIVTYPE_ASSIGN = "\u5206\u6d3e";
    var LOCID_PRIVTYPE_SHARE = "\u5171\u4eab";
    var LOCID_PRIVTYPE_REPARENT = "\u91cd\u5b9a\u7236\u7ea7";
    var LOCID_PRIVTYPE_DISABLE = "\u542f\u7528\x2f\u7981\u7528";
    var LOCID_PRIVTYPE_PUBLISH = "\u53d1\u5e03";
    var LOCID_CLOSE_BUTTON_LABEL = "\u5173\u95ed";
    var LOCID_POPUP_MENU_LABEL = "\x7b0\x7d\u83dc\u5355";
    var LOCID_HIDDEN_VALID_VALUES = "\u6b64\u63a7\u4ef6\u53ea\u63a5\u53d7\u5b57\u7b26\u4e32\u6216\u7a7a\u8f93\u5165\u3002";
    var LOCID_DEVERROR_BADTYPE_STRING = "\u6b64\u63a7\u4ef6\u53ea\u63a5\u53d7\u5b57\u7b26\u4e32\u6216\u7a7a\u8f93\u5165\u3002";
    var LOCID_DEVERROR_TOO_LONG = "\u6240\u8f93\u5165\u7684\u6587\u672c\u8d85\u51fa\u6700\u5927\u957f\u5ea6\u3002";
    var LOCID_LU_SELECT_VALUE_FOR = "\u5355\u51fb\u4ee5\u9009\u62e9\x7b0\x7d\u7684\u503c\u3002";
    var LOCID_LU_SELECT_VALUE = "\u5355\u51fb\u4ee5\u9009\u62e9\u503c\u3002";
    var LOCID_LU_ERROR_RESOLVED = "\u8bd5\u56fe\u89e3\u6790\u952e\u5165\u7684\u6587\u672c\u65f6\u51fa\u9519\u3002\u8bf7\u4f7f\u7528\u67e5\u627e\u5bf9\u8bdd\u6846\u8bbe\u7f6e\u8be5\u503c\u3002";
    var LOCID_LU_MSG_HASUNRESOLVEDITEMS = "\u6b64\u67e5\u627e\u65e0\u6cd5\u89e3\u6790\u4e3a\u7cfb\u7edf\u4e2d\u7684\u8bb0\u5f55\u3002\u4fdd\u5b58\u4e4b\u524d\u5fc5\u987b\u9009\u62e9\u8981\u4f7f\u7528\u7684\u7cfb\u7edf\u8bb0\u5f55\u3002";
    var LOCID_LU_LOOKUPUNRESOLVEDTOOLTIP = "\u672a\u627e\u5230\u4efb\u4f55\u5339\u914d\u9879";
    var LOCID_LU_LOOKUPAMBIGUOUSTOOLTIP = "\u5df2\u627e\u5230\u591a\u4e2a\u5339\u914d\u9879";
    var LOCID_SELECTBOX_BUTTON_ALT = "\u663e\u793a\u9009\u9879\u5217\u8868";
    var LOCID_FORM_REQUIRED_BKG_COLOR = "";
    var LOCID_FORM_REQUIRED_ALT = "\u5fc5\u9700";
    var LOCID_COPY_SHORTCUT_ERROR = "\u65e0\u6cd5\u5c06\u6b64\u5feb\u6377\u65b9\u5f0f\u590d\u5236\u5230\u526a\u8d34\u677f\u3002";
    var LOCID_UI_DIR = "LTR";
    var LOCID_AM_DESIGNATOR = "\u4e0a\u5348";
    var LOCID_PM_DESIGNATOR = "\u4e0b\u5348";
    var LOCID_FIRST_WEEK_SELECT = "FirstDay";
    var LOCID_UNRECOGNIZE_DOTC = "\x7b0\x7d \u4e0d\u662f\u53ef\u8bc6\u522b\u7684\u5bf9\u8c61\u7c7b\u578b\u3002";
    var LOCID_XML_PROCESS_ERROR = "\u5904\u7406\u60a8\u7684\u8bf7\u6c42\u65f6\u51fa\u9519\u3002\u8bf7\u7a0d\u5019\u518d\u91cd\u8bd5\u3002";
    var LOCID_POPUP_BLOCKER_ERROR = "Ferrari&Maserati After Sales MIS \u7a97\u53e3\u65e0\u6cd5\u6253\u5f00\uff0c\u53ef\u80fd\u5df2\u88ab\u5f39\u51fa\u7a97\u53e3\u963b\u6b62\u7a0b\u5e8f\u6240\u963b\u6b62\u3002\u8bf7\u5c06\u8fd9\u53f0 Ferrari&Maserati After Sales MIS \u670d\u52a1\u5668\u6dfb\u52a0\u5230\u60a8\u7684\u5f39\u51fa\u7a97\u53e3\u963b\u6b62\u7a0b\u5e8f\u5141\u8bb8\u6253\u5f00\u65b0\u7a97\u53e3\u7684\u7ad9\u70b9\u7684\u5217\u8868\u4e2d\x3a";
    var LOCID_BU_CANNOTDISABLE = "\u5df2\u68c0\u6d4b\u5230\u6b64\u64cd\u4f5c\u5c06\u505c\u7528\u6240\u6709\u5269\u4f59\u7684\u4e1a\u52a1\u90e8\u95e8\uff0c\u56e0\u6b64\u65e0\u6cd5\u7ee7\u7eed\u3002";
    var LOCID_DIALOG_OFFSET_WIDTH = "0";
    var LOCID_DIALOG_OFFSET_HEIGHT = "0";
    var LOCID_ERROR_DIALOG_WIDTH = "550";
    var LOCID_ERROR_DIALOG_HEIGHT = "260";
    var LOCID_CONTRACTS_TDIALOG_WIDTH = "350";
    var LOCID_CONTRACTS_TDIALOG_HEIGHT = "350";
    var LOCID_MAX_RECORDS_ERROR = "\u6700\u591a\u53ef\u4ee5\u9488\u5bf9\u6b64\u64cd\u4f5c\u9009\u62e9 10 \u6761\u8bb0\u5f55\u3002";
    var LOCID_ERROR_INVALID_VIEW = "\u6240\u9009\u89c6\u56fe\u7684\u5feb\u6377\u65b9\u5f0f\u4e0d\u53ef\u7528\u3002";
    var LOCID_ARRAY_SHORT_MONTHS = "1 \u6708,2 \u6708,3 \u6708,4 \u6708,5 \u6708,6 \u6708,7 \u6708,8 \u6708,9 \u6708,10 \u6708,11 \u6708,12 \u6708";
    var LOCID_ARRAY_LONG_MONTHS = "\u4e00\u6708,\u4e8c\u6708,\u4e09\u6708,\u56db\u6708,\u4e94\u6708,\u516d\u6708,\u4e03\u6708,\u516b\u6708,\u4e5d\u6708,\u5341\u6708,\u5341\u4e00\u6708,\u5341\u4e8c\u6708,";
    var LOCID_ARRAY_SHORT_DAYS = "\u65e5,\u4e00,\u4e8c,\u4e09,\u56db,\u4e94,\u516d";
    var LOCID_ARRAY_SHORTEST_DAYS = "\u65e5,\u4e00,\u4e8c,\u4e09,\u56db,\u4e94,\u516d";
    var LOCID_ARRAY_LONG_DAYS = "\u661f\u671f\u65e5,\u661f\u671f\u4e00,\u661f\u671f\u4e8c,\u661f\u671f\u4e09,\u661f\u671f\u56db,\u661f\u671f\u4e94,\u661f\u671f\u516d";
    var LOCID_SHOW_WEEK_CAL_WIDTH = "170";
    var LOCID_NO_WEEK_CAL_WIDTH = "150";
    var LOCID_CALENDAR_HEIGHT = "163";
    var LOCID_TODAY_DATE_FORMAT_MASK = "\u4eca\u5929\x3a\x7b0\x7d";
    var LOCID_ALERT_ENTER_VALID_DATE = "\u6307\u5b9a\u7684\u65e5\u671f\u683c\u5f0f\u65e0\u6548\u6216\u65e5\u671f\u8d85\u51fa\u4e86\u6709\u6548\u8303\u56f4\u3002\u8bf7\u6309\u4ee5\u4e0b\u683c\u5f0f\u8f93\u5165\u6709\u6548\u7684\u65e5\u671f\x3a \x7b0\x7d";
    var LOCID_ALERT_CALDATE_FAIL = "\u83b7\u53d6\u65e5\u671f\u65f6\u51fa\u9519";
    var LOCID_ALERT_ACTUAL_DATE_FAIL = "\u83b7\u53d6\u65e5\u671f\u65f6\u51fa\u9519";
    var LOCID_YEAR_DISPLAYFORMAT = "\x7b0\x7d\x7b1\x7d \u5e74";
    var LOCID_SINGULAR_MINUTE = "\u5206\u949f";
    var LOCID_PLURAL_MINUTE = "\u5206\u949f";
    var LOCID_SINGULAR_HOUR = "\u5c0f\u65f6";
    var LOCID_PLURAL_HOUR = "\u5c0f\u65f6";
    var LOCID_SINGULAR_DAY = "\u5929";
    var LOCID_PLURAL_DAY = "\u5929";
    var LOCID_VALID_DURATION = "\u5fc5\u987b\u8f93\u5165\u6709\u6548\u7684\u6301\u7eed\u65f6\u95f4\u3002";
    var LOCID_ERROR_SAVE_DURATION = "Ferrari&Maserati After Sales MIS \u65e0\u6cd5\u4fdd\u5b58\u5bf9\u6301\u7eed\u65f6\u95f4\u7684\u66f4\u6539\u3002\u8bf7\u91cd\u8bd5\u66f4\u6539\u6301\u7eed\u65f6\u95f4\u7684\u503c\u3002";
    var LOCID_1_MINUTE = "1 \u5206\u949f";
    var LOCID_5_MINUTES = "5 \u5206\u949f";
    var LOCID_15_MINUTES = "15 \u5206\u949f";
    var LOCID_30_MINUTES = "30 \u5206\u949f";
    var LOCID_45_MINUTES = "45 \u5206\u949f";
    var LOCID_1_HOUR = "1 \u5c0f\u65f6";
    var LOCID_1_5_HOURS = "1.5 \u5c0f\u65f6";
    var LOCID_2_HOURS = "2 \u5c0f\u65f6";
    var LOCID_2_5_HOURS = "2.5 \u5c0f\u65f6";
    var LOCID_3_HOURS = "3 \u5c0f\u65f6";
    var LOCID_3_5_HOURS = "3.5 \u5c0f\u65f6";
    var LOCID_4_HOURS = "4 \u5c0f\u65f6";
    var LOCID_4_5_HOURS = "4.5 \u5c0f\u65f6";
    var LOCID_5_HOURS = "5 \u5c0f\u65f6";
    var LOCID_5_5_HOURS = "5.5 \u5c0f\u65f6";
    var LOCID_6_HOURS = "6 \u5c0f\u65f6";
    var LOCID_6_5_HOURS = "6.5 \u5c0f\u65f6";
    var LOCID_7_HOURS = "7 \u5c0f\u65f6";
    var LOCID_7_5_HOURS = "7.5 \u5c0f\u65f6";
    var LOCID_8_HOURS = "8 \u5c0f\u65f6";
    var LOCID_1_DAY = "1 \u5929";
    var LOCID_2_DAYS = "2 \u5929";
    var LOCID_3_DAYS = "3 \u5929";
    var LOCID_DURATION_BADTYPE = "\u6b64\u63a7\u4ef6\u53ea\u63a5\u53d7\u4ecb\u4e8e \x7b0\x7d \u548c \x7b1\x7d \u4e4b\u95f4\u7684\u6574\u6570\u6216\u8005\u53ea\u80fd\u8f93\u5165\u7a7a\u3002";
    var LOCID_DURATION_NOSAVE = "Ferrari&Maserati After Sales MIS \u65e0\u6cd5\u4fdd\u5b58\u5bf9\u6301\u7eed\u65f6\u95f4\u7684\u66f4\u6539\u3002\u8bf7\u91cd\u8bd5\u66f4\u6539\u6301\u7eed\u65f6\u95f4\u7684\u503c\u3002";
    var LOCID_ONE_MINUTE_MASK = "\x7b0\x7d \u5206\u949f";
    var LOCID_N_MINUTES_MASK = "\x7b0\x7d \u5206\u949f";
    var LOCID_1_HOUR_MASK = "\x7b0\x7d \u5c0f\u65f6";
    var LOCID_N_HOURS_MASK = "\x7b0\x7d \u5c0f\u65f6";
    var LOCID_1_DAY_MASK = "\x7b0\x7d \u5929";
    var LOCID_N_DAYS_MASK = "\x7b0\x7d \u5929";
    var LOCID_DTM_BLANK_DATE_ERROR = "\u5fc5\u987b\u63d0\u4f9b\u65e5\u671f\u3002";
    var LOCID_DTM_BLANK_TIME_ERROR = "\u8bf7\u8f93\u5165\u6709\u6548\u7684\u65f6\u95f4\u3002";
    var LOCID_TIME_SEPARATOR = "\x3a";
    var LOCID_FORMS_SAVE_CONFIRM_TITLE = "\u5c1a\u672a\u4fdd\u5b58\u6240\u505a\u7684\u66f4\u6539\u3002\u8981\u505c\u7559\u5728\u8be5\u9875\u9762\u4e0a\uff0c\u4ee5\u4fbf\u4fdd\u5b58\u6240\u505a\u7684\u66f4\u6539\uff0c\u8bf7\u5355\u51fb\u201c\u53d6\u6d88\u201d\u3002";
    var LOCID_FORM_PROIVE_VALUE_MASK = "\u5fc5\u987b\u63d0\u4f9b\x7b0\x7d\u7684\u503c\u3002";
    var LOCID_FORM_PRINT_DIRTY_MESSAGE = "\u6b64\u8868\u5355\u5df2\u66f4\u6539\uff0c\u6253\u5370\u4e4b\u524d\u5fc5\u987b\u8fdb\u884c\u4fdd\u5b58\u3002";
    var LOCID_LOOKUPSTYLE_NOT_SET = "\u672a\u77e5\u7684\u67e5\u627e\u6837\u5f0f\u3002\u8bf7\u68c0\u67e5\u5c5e\u6027 XML \u7684\u8bbe\u7f6e\u662f\u5426\u6b63\u786e\u3002";
    var LOCID_LOOKMORERECORDS_AMBIGUOUS = "\u67e5\u627e\u66f4\u591a\u8bb0\u5f55";
    var LOCID_LOOKUPAMBIGUOUSTITLE = "\u5df2\u627e\u5230\u591a\u4e2a\u5339\u914d\u9879\x3a";
    var LOCID_ENTER_VALID_NUMBER = "\u5fc5\u987b\u8f93\u5165\u6709\u6548\u7684\u6570\u5b57\u3002";
    var LOCID_REMOTECOMMAND_ERROR = "\u53d1\u751f\u4e86\u9519\u8bef\u3002\u8bf7\u91cd\u8bd5\u6b64\u64cd\u4f5c\u3002\u5982\u679c\u95ee\u9898\u4ecd\u7136\u5b58\u5728\uff0c\u8bf7\u8bbf\u95ee Ferrari&Maserati After Sales MIS \u793e\u533a\u4ee5\u83b7\u53d6\u89e3\u51b3\u65b9\u6848\u6216\u8005\u4e0e\u60a8\u6240\u5728\u7ec4\u7ec7\u7684 Ferrari&Maserati After Sales MIS \u7ba1\u7406\u5458\u8054\u7cfb\u3002\u6700\u540e\uff0c\u60a8\u53ef\u4ee5\u4e0e Microsoft \u652f\u6301\u8054\u7cfb\u3002";

    var WEB_APP_URL = "";
    var HELP_SKU = "OP";
    var _iPrivilegeLevelNone = 1;
    var _iPrivilegeLevelBasic = 2;
    var _iPrivilegeLevelLocal = 4;
    var _iPrivilegeLevelDeep = 8;
    var _iPrivilegeLevelGlobal = 16;
    var _sPrivilegeLevelNone = "X";
    var _sPrivilegeLevelBasic = "B";
    var _sPrivilegeLevelLocal = "L";
    var _sPrivilegeLevelDeep = "D";
    var _sPrivilegeLevelGlobal = "G";
    var _sPrivilegeColNone = 0;
    var _sPrivilegeColCreate = 1;
    var _sPrivilegeColRead = 2;
    var _sPrivilegeColWrite = 3;
    var _sPrivilegeColDelete = 4;
    var _sPrivilegeColAppend = 5;
    var _sPrivilegeColAppendTo = 6;
    var _sPrivilegeColAssign = 7;
    var _sPrivilegeColShare = 8;
    var _sPrivilegeColReparent = 9;
    var _sPrivilegeColDisable = 10;
    var _sPrivilegeColPublish = 11;
    var _saveAndNewEnabled = true;
    var HELP_SKU = "OP";
    var LOCID_GRID_NOT_FOUND = "\u65e0\u6cd5\u83b7\u53d6\u5bf9\u7f51\u683c\u7684\u5f15\u7528\u3002";
    var IS_LIVE = false;
    var IS_PATHBASEDURLS = true;
    var ORG_UNIQUE_NAME = "webs";
    var _ErrorCodesIsvAborted = "0x80040265";
    var ScriptErrorReportingPreference = 1;
    var ScriptErrorStatusBar = "\u7f51\u9875\u4e0a\u6709\u9519\u8bef\u3002";
    var _bPresenceEnabled = true;
    var ORG_DATE_FORMATSTRING = "yyyy\x2fM\x2fd";
    var ORG_IS_GREGORIANCALENDAR = false;
    var ORG_DATE_SEPARATOR = "-";
    var ORG_DATE_START_DAY = 0;
    var ORG_LANGUAGE_CODE = 2052;
    var ORG_NUMBER_FORMAT_MASK = "\x23,\x23\x230.\x2a\x3b\x7e\x23,\x23\x230.\x2a";
    var ORG_TIME_FORMAT = 0;
    var ORG_SHOW_WEEK_NUMBER = false;
    var ORG_NUMBER_DECIMAL_SEPARATOR = ".";
    var ORG_NUMBER_GROUP_SEPARATOR = ",";
    var AUTHENTICATION_TYPE = 0;
    var ORG_TIMEZONE_OFFSET = 480;
    var USER_DATE_FORMATSTRING = "yyyy\x2fM\x2fd";
    var USER_IS_GREGORIANCALENDAR = true;
    var USER_DATE_SEPARATOR = "-";
    var USER_DATE_FORMATTED_FORMATSTRING = "yyyy\x2fM\x2fd";
    var DEFAULT_USER_NUMBER_FORMAT_MASK = "\x23,\x23\x230.\x2a\x3b\x7e\x23,\x23\x230.\x2a";
    var USER_LANGUAGE_CODE = 2052;
    var USER_HELP_LCID = "2052";
    var USER_NUMBER_FORMAT_MASK = "\x23,\x23\x230.\x2a\x3b\x7e\x23,\x23\x230.\x2a";
    var USER_TIME_FORMAT = "H\x3amm";
    var USER_SHOW_WEEK_NUMBER = false;
    var USER_NUMBER_DECIMAL_SEPARATOR = ".";
    var USER_NUMBER_GROUP_SEPARATOR = ",";
    var HELP_SERVER_URL = "";
    </script>

    <script type="text/javascript" src="../_static/_common/scripts/encodedecode.js"></script>

    <script type="text/javascript" src="../_static/_controls/util/util.js"></script>

    <script type="text/javascript" src="../_static/_common/scripts/global.js"></script>

    <script type="text/javascript" src="../_static/_common/scripts/xmlutil.js"></script>

    <script type="text/javascript" src="../_static/_controls/remotecommands/remotecommand.js"></script>

    <script type="text/javascript" src="../_common/windowinformation/windowinformation.js"></script>

    <script type="text/javascript" src="../_static/_forms/postbackutil.js"></script>

    <script type="text/javascript" src="../_static/_grid/cmds/util.js"></script>

    <script type="text/javascript" src="../_static/biz/roles/scripts/actions.js"></script>

    <script type="text/javascript" src="../_static/_controls/lookup/lookup.js"></script>

    <script type="text/javascript" src="../_static/_controls/popupmenu/popupmenu.js"></script>

    <script type="text/javascript" src="../_static/_common/scripts/presence.js"></script>

    <script type="text/javascript" src="../_static/_common/scripts/details.js"></script>

    <script type="text/javascript" src="../_static/_grid/action.js"></script>

    <script type="text/javascript" src="../_static/_forms/addrelated.js"></script>

    <script type="text/javascript" src="../_static/_forms/formaction.js"></script>

    <script type="text/javascript" src="../_static/_controls/datetime/date.js"></script>

    <script type="text/javascript" src="../_static/_controls/datetime/time.js"></script>

    <script type="text/javascript" src="../_static/_controls/number/number.js"></script>

    <script type="text/javascript" src="../_static/_common/scripts/select.js"></script>

    <script type="text/javascript" src="../_static/advancedfind/cachemanager.js"></script>

    <script type="text/javascript" src="../_static/_jQuery/jquery-1.3.2.min.js"></script>

    <script type="text/javascript" src="../_static/_jQuery/jquery_validator.js"></script>

    <link rel="stylesheet" type="text/css" href="../_common/styles/global.css" />
    <link rel="stylesheet" type="text/css" href="../_common/styles/global-styles.css" />
    <link rel="stylesheet" type="text/css" href="../_common/styles/global-dynamic-styles.css" />
    <link rel="stylesheet" type="text/css" href="../_common/styles/fonts.css" />
    <link rel="stylesheet" type="text/css" href="../_nav/menu.css" />
    <link rel="stylesheet" type="text/css" href="../_forms/controls/controls.css" />
    <link rel="stylesheet" type="text/css" href="../_controls/notifications/notifications.css" />
    <link rel="stylesheet" type="text/css" href="../_common/styles/select.css" />
    <link rel="stylesheet" type="text/css" href="../_forms/controls/form.css" />
    <link rel="stylesheet" type="text/css" href="../_nav/tabs.css" />
    <link rel="stylesheet" type="text/css" href="../_controls/popupmenu/popupmenu.css" />
    <link rel="stylesheet" type="text/css" href="../crmreports/filtereditor.css" />
    <link rel="stylesheet" type="text/css" href="../_common/styles/minical.css" />

    <script type="text/javascript">
    function LocalDateTimeNow() 
    {
        var dNow = new Date(); 
        dNow.setMinutes(dNow.getMinutes() + (dNow.getTimezoneOffset()) + ORG_TIMEZONE_OFFSET); 
        return dNow; 
    }
    
    var _oSrc = "../_imgs/ico_18_role_";
    var _bSaving = false;

    var _roleFormReadOnlyOrDisabled = false;
    $(document).ready(setup);
    function setup()
    { 
        validator.setup("#crmForm");
        if(GetQueryString("otype") == "modify")
        {
            InitializePrivilege();
            if(!_roleFormReadOnlyOrDisabled)
            {
                crmForm.attachEvent("onsave", Save);
                crmForm.attachEvent("onclose", Close);
            }
        }
    }

    function Save()
    {
        if(GetQueryString("otype") == "modify")
        {
            CreatePrivilegeValue();
            //alert(document.getElementById("privilegeinfo").value);
            if(document.getElementById("privilegeinfo").value == "")
            {
                theForm.__EVENTARGUMENT.value = "unchange";
                //alert("用户组的权限未进行设置，不能执行保存操作！");
            }
            return true;

        }
        else
            return true;
    }
    function Clone()
    {
        copyRole(crmFormSubmit.crmFormSubmitId.value);

        try
        {
             window.opener.auto(Role);
        }
        catch(e)
        {}
    }

    function CreatePrivilegeValue()
    {
        var retval	= "";
        var	aoImg   = document.all.tags("IMG");
        var nLength = aoImg.length;

        for (var i = 0; i < nLength; i++)
        {
            var oImg	= aoImg[i];

            if (IsNull(oImg.PrivilegeDepth))
            {
                continue;
            }

            if (oImg.PrivilegeDepth != _iPrivilegeLevelNone)
            {
                retval += oImg.PrivilegeValue;
            }
        }

        crmForm.privilegeinfo.value = retval;
    }
    function ProcessClick()
    {
        if (_bSaving || _roleFormReadOnlyOrDisabled)
             return false;
             
        var o = event.srcElement;
        while((o.tagName != "IMG") && (o.firstChild != null))
        {
            o = o.firstChild;
        }
        if (!IsNull(o.PrivilegeDepth) && o.tagName == "IMG")
        {
            IncrementCellUI(o, true);
        }
    }

    function SetAltText()
    {
        if (_bSaving) 
            return false;
            
        var o = event.srcElement;
        if (o.tagName == "TD" && o.cellIndex == 0 && o.parentElement.rowIndex != 0 && o.className == "h")
        {
            o.title = LOCID_TOGGLE_ROW_PRIV;
            return;
        }
        else if (o.tagName != "IMG")
        {
            return;
        }
    }

    function ToggleColumnCells(oTable, nColumn)
    {
        var nRows = oTable.rows.length;

        var nNext	= _iPrivilegeLevelGlobal;

        var bReset	= true;
        var oaCells = new Array();


        for (var i=1; i < nRows; i++)
        {


            var oCurrent = oTable.rows[i].cells[nColumn].firstChild;
            if (IsNull(oCurrent.tagName) || oCurrent.tagName != "IMG" || IsNull(oCurrent.PrivilegeDepth))
            {
                continue;
            }
            
            var nLevel   = oCurrent.PrivilegeDepth;
            if (nLevel < oCurrent.Max)
            {
                nLevel = oCurrent.NextPrivilege;
                if (nLevel <= nNext && nLevel != oCurrent.Min)
                {
                    nNext			= nLevel;
                    bReset			= false;
                }
            }
            oaCells[i-1] = oCurrent;
        }
        UpdateCells(oaCells, nNext, bReset);
    }


    function ToggleRowCells(oRow)
    {
        var oCells  = oRow.cells;
        var nCells  = oCells.length;


        var nNext	= _iPrivilegeLevelGlobal;

        var bReset	= true;
        var oaCells = new Array();


        for (var i=1; i < nCells; i++)
        {
            var oCurrent = oCells[i].firstChild;
            if (IsNull(oCurrent.tagName) || oCurrent.tagName != "IMG" || IsNull(oCurrent.PrivilegeDepth))
            {
                continue;
            }
            var nLevel   = oCurrent.PrivilegeDepth;

            if (nLevel < oCurrent.Max)
            {
                nLevel = oCurrent.NextPrivilege;
                if (nLevel <= nNext && nLevel != oCurrent.Min)
                {
                    nNext			= nLevel;
                    bReset			= false;
                }
            }
            oaCells[i-1] = oCurrent;
        }
        UpdateCells(oaCells, nNext, bReset);
    }


    function UpdateCells(oaCells, nNext, bReset)
    {
        for (nCell in oaCells)
        {
            var oCell = oaCells[nCell];
            if (bReset)
            {
                oCell.Reset();
            }
            else if (!IsNull(oCell.NextPrivilege) && oCell.NextPrivilege <= nNext)
            {
                IncrementCellUI(oCell, false);
            }
        }
    }


    function IncrementCellUI(oImg, bReset)
    {
        if (IsNull(oImg) || IsNull(oImg.PrivilegeDepth))
        {
            return null;
        }
        if (oImg.PrivilegeDepth < oImg.Max)
        {
            oImg.PrivilegeDepth = oImg.NextPrivilege;
        }
        else if (!IsNull(bReset) && bReset)
        {
            oImg.Reset();
        }
        
        crmForm.privilegeinfo.value = "dirty";
    }


    function GetTitle(nDepth)
    {
        switch (nDepth)
        {
            case _iPrivilegeLevelNone:
                return LOCID_BIZ_ROLE_NONE;
            case _iPrivilegeLevelBasic:
                return LOCID_BIZ_ROLE_BASIC;
            case _iPrivilegeLevelLocal:
                return LOCID_BIZ_ROLE_LOCAL;
            case _iPrivilegeLevelDeep:
                return LOCID_BIZ_ROLE_DEEP;
            case _iPrivilegeLevelGlobal:
                return LOCID_BIZ_ROLE_GLOBAL;
            default:
                return "";
        }
    }

    function GetEncodedPrivilegeAltTag(objectTypeName, privilegeTypeCode, currentPrivilegeDepth)
    {
        return formatString(LOCID_FORMAT_ALTTAG,objectTypeName, GetTitle(currentPrivilegeDepth));
    }

    function GetEncodedMiscPrivilegeAltTag(privilegeName, currentPrivilegeDepth)
    {
        return formatString(LOCID_FORMAT_ALTTAGMISC, privilegeName, GetTitle(currentPrivilegeDepth));
    }
    function GetDisplayPrivilegeType(privilegeTypeCode)
    {
        switch (privilegeTypeCode)
        {
            case _sPrivilegeColCreate:
                return LOCID_PRIVTYPE_CREATE;
            case _sPrivilegeColRead:
                return LOCID_PRIVTYPE_READ;
            case _sPrivilegeColWrite:
                return LOCID_PRIVTYPE_WRITE;
            case _sPrivilegeColDelete:
                return LOCID_PRIVTYPE_DELETE;
            case _sPrivilegeColAppend:
                return LOCID_PRIVTYPE_APPEND;
            case _sPrivilegeColAppendTo:
                return LOCID_PRIVTYPE_APPENDTO;
            case _sPrivilegeColAssign:
                return LOCID_PRIVTYPE_ASSIGN;
            case _sPrivilegeColShare:
                return LOCID_PRIVTYPE_SHARE;
            case _sPrivilegeColReparent:
                return LOCID_PRIVTYPE_REPARENT;
            case _sPrivilegeColDisable:
                return LOCID_PRIVTYPE_DISABLE;
            case _sPrivilegeColPublish:
                return LOCID_PRIVTYPE_PUBLISH;
            default:
                return "";
        }
    }

    function GetDepth(sDepth)
    {
        switch (sDepth)
        {
            case _sPrivilegeLevelNone:
                return _iPrivilegeLevelNone;
            case _sPrivilegeLevelBasic:
                return _iPrivilegeLevelBasic;
            case _sPrivilegeLevelLocal:
                return _iPrivilegeLevelLocal;
            case _sPrivilegeLevelDeep:
                return _iPrivilegeLevelDeep;
            case _sPrivilegeLevelGlobal:
                return _iPrivilegeLevelGlobal;
            default:
                return -1;
        }
    }

    function ToggleRow()
    {
        if(_roleFormReadOnlyOrDisabled) return false;

        var o = event.srcElement;

        var oTR = o;
        while (oTR.tagName != "TR")
        {
            oTR = oTR.parentElement;
        }
        ToggleRowCells(oTR);
    }

    function ToggleColumn()
    {
        if(_roleFormReadOnlyOrDisabled)
            return false;

        var o = event.srcElement;
        var oTable = o;
        while (oTable.tagName != "TABLE")
        {
            oTable = oTable.parentElement;
        }
        ToggleColumnCells(oTable, o.cellIndex);
    }

    function BlockEnter()
    {
        switch (event.keyCode)
        {
            case 13:
                event.returnValue = false;
        }
    }
    
    ///初始化模块权限
    function InitializePrivilege()
    {
        var _rolesId = document.getElementById("txtRolsId").value;
        if(!IsNull(_rolesId))
        {
        	$.ajax({
                type:     "POST",
                url:      "rolesettings.aspx",
                dataType: "xml",
                data:     { ajaxroleid : _rolesId, otype : "getprivileges" },
                timeout:  1000,
                error: function(){ alert("Error loading XML document!"); },
                success: function(xml){
                    $(xml).find("privilegeslist").each(function(i){
                        var _obj = document.getElementById("roles_"+$(this).find("privilegeid").text());
                        _obj.d = Number($(this).find("depthmask").text());
                        switch(_obj.d)
	                    {
	                        case _iPrivilegeLevelBasic:
	                            _obj.src = _oSrc + _sPrivilegeLevelBasic + ".gif";
	                            break;
	                        case _iPrivilegeLevelLocal:
	                            _obj.src = _oSrc + _sPrivilegeLevelLocal + ".gif";
	                            break;
	                        case _iPrivilegeLevelBasic:
	                            _obj.src = _oSrc + _sPrivilegeLevelBasic + ".gif";
	                            break;
	                        case _iPrivilegeLevelGlobal:
	                            _obj.src = _oSrc + _sPrivilegeLevelGlobal + ".gif";
	                            break;
	                        default:
	                            _obj.src = _oSrc + _sPrivilegeLevelNone + ".gif";
	                            break;
	                    }
                    }); 
                } 
            });
		}
    }
    </script>

    <style type="text/css">
    div.savingMsg
    {
        width:350px;
        height:150px;
        filter:progid:DXImageTransform.Microsoft.Shadow(Direction=135, Color='#666666', Strength=4);
        background-color: #ffffee;
        border: 2px solid #000000;
        position: absolute;
        top: 160px;
    }
    td.msg
    {
        font-weight: bold;
        font-size: 15px;
        color: #000099;
        text-align: center;
        vertical-align: middle;
        cursor: wait;
    }
    td.h
    {
        cursor:	hand;
    }
    tr.on
    {
        background-color:#eaeaff;
    }
    table.ms-crm-Form-Area
    {
        width: 100%;
        border-bottom: 1px solid #dddddd;
        table-layout: fixed;
    }
    IMG.i
    {
        behavior:		url(../_static/biz/roles/controls/roleitem.htc);
        cursor:			hand;
    }
    </style>
</head>
<body>
    <div class="ms-crm-Form-Area">
        <table class="ms-crm-Roles-Form-Layout" cellspacing="0" cellpadding="0">
            <tr height="52">
                <td width="100%">
                    <span id="crmMenuBar">
                        <table cellspacing="0" cellpadding="0" width="100%">
                            <tbody>
                                <tr>
                                    <td>
                                        <table class="ms-crm-MenuBar" id="mnuBar1" cellspacing="0" cellpadding="0">
                                            <tbody>
                                                <tr>
                                                    <td class="ms-crm-MenuBar-Items" nowrap align="left">
                                                        <ul class="ms-crm-MenuBar-Left">
                                                            <li class="ms-crm-Menu" id="file" title="File(F)" accesskey="F" tabindex="-1" menu="mnufile">
                                                                <span class="ms-crm-Menu-JewelButton"><a class="ms-crm-Menu-JewelButton" onclick="return false;"
                                                                    tabindex="0" href="javascript:onclick();" target="_self">
                                                                    <img class="ms-crm-Menu-JewelButton" alt="File(F)" src="../_imgs/dia_am_log.gif"
                                                                        iconimage="../_imgs/dia_am_log.gif" hoverimage="../_imgs/dia_am_log.gif" openimage="../_imgs/dia_am_log.gif"></a></span>
                                                            </li>
                                                            <li class="ms-crm-Menu" id="_MBcrmFormSave" title="Save(S)" onclick="window.execScript(action)"
                                                                tabindex="-1" action="if(validator.validatorAll()){this.disabled=true;success.style.display='block';HideOverSels('success');__doPostBack('saveinfo','');}">
                                                                <span class="ms-crm-Menu-Label"><a class="ms-crm-Menu-Label" onclick="return false;"
                                                                    tabindex="-1" href="javascript:onclick();" target="_self" style="cursor: pointer;">
                                                                    <img class="ms-crm-Menu-ButtonFirst" tabindex="0" alt="Save(S)" src="../_imgs/ico/16_save.gif">保存</a></span></li>
                                                        </ul>
                                                    </td>
                                                    <td class="ms-crm-MenuBar-Items ms-crm-Menu-ICRight" nowrap>
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </span>
                    <table class="ms-crm-Form-Title-NoNav" cellspacing="0" cellpadding="0">
                        <tbody>
                            <tr class="ms-crm-Form-Title">
                                <td class="ms-crm-Form-Title" nowrap>
                                    <span class="ms-crm-Form-Breadcrumb">系统角色 : <span id="spanRoleName" runat="server">
                                        新增角色 </span></span>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
            <tr class="ms-crm-Form-Background">
                <td id="tdAreas" style="padding: 10px; padding-bottom: 0px;" colspan="2">
                    <div id="areaForm">
                        <form id="crmForm" name="crmForm" runat="server" class="ms-crm-Form" method="post">
                            <input type="hidden" id="txtCategoryCount" value="0" runat="server" />
                            <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
                            <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />

                            <script type="text/javascript">
                            <!--
                            var theForm = document.forms["crmForm"];
                            if (!theForm) {
                                theForm = document.form1;
                            }
                            function __doPostBack(eventTarget, eventArgument) {
                                if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
                                    theForm.__EVENTTARGET.value = eventTarget;
                                    if(Save())
                                    {
                                        theForm.submit();
                                    }
                                }
                            }
                            // -->
                            </script>

                            <div id="success" style="position: absolute; z-index: 300; height: 120px; width: 284px;
                                left: 50%; top: 50%; margin-left: -150px; margin-top: -80px;">
                                <div id="Layer2" style="position: absolute; z-index: 300; width: 270px; height: 90px;
                                    background-color: #FFFFFF; border: solid #000000 1px; font-size: 14px;">
                                    <div id="Layer4" style="height: 26px; background: #D3DBDE; line-height: 26px; padding: 0px 3px 0px 3px;
                                        font-weight: bolder;">
                                        Notes</div>
                                    <div id="Layer5" style="height: 64px; line-height: 150%; padding: 0px 3px 0px 3px;"
                                        align="center">
                                        <br />
                                        <table>
                                            <tr>
                                                <td valign="top">
                                                    <img border="0" src="../_imgs/AdvFind/progress.gif" /></td>
                                                <td valign="middle" style="font-size: 14px;">
                                                    Loading...<br />
                                                </td>
                                            </tr>
                                        </table>
                                        <br />
                                    </div>
                                </div>
                                <div id="Layer3" style="position: absolute; width: 270px; height: 108px; z-index: 299;
                                    left: 4px; top: 5px; background-color: #E8E8E8;">
                                </div>
                            </div>

                            <script type="text/javascript"> 
                                document.getElementById('success').style.display = "none"; 
                            </script>

                            <script type="text/javascript" src="../_static/_common/scripts/divcover.js"></script>

                            <input id="txtRolsId" runat="server" type="text" style="display: none;" />
                            <input type="hidden" name="crmFormRootElem" value="role" />
                            <input type="text" id="privilegeinfo" class="ms-crm-Hidden" value req="0" style="display: none;"
                                runat="server" donotsubmit="1" />
                            <table height="100%" cellspacing="0" cellpadding="0" width="100%">
                                <tbody>
                                    <tr height="1">
                                        <td>
                                            <div class="Notifications" id="Notifications" style="display: none" size="3" maxheight="66">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="ms-crm-TabBar-Cell">
                                            <ul class="ms-crm-TabBar" id="tabBar" valign="bottom" nowrap>
                                                <li class="ms-crm-Tab ms-crm-Tab-Selected" id="tab0Tab" tabindex="-1" tabid="tab0"><a
                                                    onclick="return false;" href="javascript:onclick();" target="_self">General</a></li>
                                                <%=FunctionCategoryItems%>
                                            </ul>
                                        </td>
                                    </tr>
                                    <tr height="100%">
                                        <td>
                                            <div class="ms-crm-Tab" id="tab0" style="overflow-y: auto; display: inline">
                                                <table style="table-layout: fixed" cellspacing="0" cellpadding="3" width="100%">
                                                    <colgroup>
                                                        <col width="150" />
                                                        <col />
                                                        <col width="150" style="text-align: right;" />
                                                        <col />
                                                    </colgroup>
                                                    <tbody>
                                                        <tr>
                                                            <td class="ms-crm-Field-Required">
                                                                <label for="txtRoleName">
                                                                    名称:<img alt="必需" src="../_imgs/frm_required.gif" /></label></td>
                                                            <td>
                                                                <input class="ms-crm-Text" id="txtRoleName" maxlength="100" runat="server" required="required"
                                                                    controlname="名称" isvalidator /></td>
                                                            <td class="ms-crm-Field-Required">
                                                                <label for="selIsLockout">
                                                                    状态:</label></td>
                                                            <td>
                                                                <select id="selIsLockout" class="ms-crm-SelectBox" runat="server">
                                                                    <option value="0">Active</option>
                                                                    <option value="1">Locked</option>
                                                                </select>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="ms-crm-Field-Required">
                                                                <label for="txtLineNum">
                                                                    序号:</label></td>
                                                            <td>
                                                                <input class="ms-crm-Text" id="txtLineNum" runat="server" style="width: 60px;" required="required"
                                                                    controlname="" datatype="number" isvalidator /></td>
                                                            <td class="ms-crm-Field-Required">
                                                            </td>
                                                            <td>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="ms-crm-Field-Required">
                                                                <label for="txtDescription">
                                                                    描述:</label></td>
                                                            <td colspan="3">
                                                                <textarea id="txtDescription" cols="20" rows="4" runat="server"></textarea>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </div>
                                            <%=PrivilegeItems%>
                                        </td>
                                    </tr>
                                    <tr height="70">
                                        <td style="padding: 10px; padding-bottom: 20px;">
                                            <fieldset>
                                                <legend>&nbsp;<span style="font-weight: bold">Notes:</span>&nbsp;</legend>
                                                <table width="100%" height="100%" cellspacing="3" style="margin-top: 3px; table-layout: fixed;"
                                                    onmouseover="SetAltText();">
                                                    <colgroup>
                                                        <col width="16">
                                                        <col>
                                                        <col width="16">
                                                        <col>
                                                        <col width="16">
                                                        <col>
                                                        <col width="16">
                                                        <col>
                                                        <col width="16">
                                                        <col>
                                                    </colgroup>
                                                    <tbody>
                                                        <tr>
                                                            <td>
                                                                <img alt="" src="../_imgs/ico_18_role_X.gif"></td>
                                                            <td>
                                                                Nothing selection</td>
                                                            <td>
                                                                <img alt="" src="../_imgs/ico_18_role_B.gif"></td>
                                                            <td>
                                                                个人</td>
                                                            <td>
                                                                <img alt="" src="../_imgs/ico_18_role_L.gif"></td>
                                                            <td>
                                                                部门</td>
                                                            <td>
                                                                <img alt="" src="../_imgs/ico_18_role_G.gif"></td>
                                                            <td>
                                                                公司</td>
                                                            <td>
                                                                &nbsp;</td>
                                                            <td>
                                                                &nbsp;</td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </fieldset>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </form>
                    </div>
                </td>
            </tr>
        </table>
    </div>
</body>
</html>
